Skip to content

Show a column with failed data as error in the data table - #2011

Draft
AStaroverov wants to merge 1 commit into
mainfrom
fix/errored-column-data-status
Draft

AStaroverov wants to merge 1 commit into
mainfrom
fix/errored-column-data-status

Conversation

@AStaroverov

Copy link
Copy Markdown
Collaborator

Problem

A table built with createPlDataTableV3 reads the .data field of its visible columns to give each a status. That read used ignoreError, so a column whose data failed was handled wrong either way:

.data field Before Now
error, no value the read throws, the whole table output fails error
error and a value ready error

The UI already renders the error status; nothing produced it.

Change

  • The leaf data read (data_column.ts) tells a field that holds an error from one that has no value yet. getData() gives undefined for it and no longer throws; DataColumnImpl.hasDataError() reports it.
  • getColumnDataState(recipe) returns ready, pending or errored. hasColumnData is now getColumnDataState(...) === "ready".
  • buildDataStatusMap maps errored to the error status.

No new reads

Reading a .data field subscribes the output to it, so the error is taken only from the read that was already made:

  • getDataStatus() is unchanged: it looks at the field list only and does not read the field. ColumnFieldStatus and ColumnResolutionStatus keep their values.
  • The probe reads the same fields in the same order as before and stops at the first leaf whose data is not ready, as hasColumnData did.
  • The error is detected from that one read of the field; the data resource is not entered.

Compatibility

A block picks this up when it is rebuilt with this SDK. It works on any desktop: no new host method is used. The empty column in the frame itself comes from #2010; on a desktop without it, the frame still fails for such a column as it does today.

Not covered

Tests

  • data_column.test.ts: data of a leaf for a field with a value, without a value, with an error, with an error and a value; a materialised column.
  • columns/utils.test.ts: getColumnDataState for each field state, a failed leaf after a ready one, and the stop at the first leaf that is not ready.
  • createPlDataTable/utils.test.ts: buildDataStatusMap over ready, no bytes, unset, resolving, absent and both failed states. Fails on main with the thrown field error.
  • The test stub's traverse follows the tree's rule for a field error (thrown unless ignored and the field has a value).

The leaf data read tells a .data field that holds an error from one that has no value yet. DataColumn gives no data for it, and the probe the table runs over its visible columns reports it, so the column gets the error status and the table output no longer throws. No new read is made: the error comes from the read of the field the probe already does.
@changeset-bot

changeset-bot Bot commented Nov 16, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 5a42b6e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@platforma-sdk/model Patch
@milaboratories/pl-middle-layer Patch
@milaboratories/uikit Patch
@platforma-sdk/test Patch
@platforma-sdk/ui-vue Patch
@platforma-sdk/pl-cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codecov

codecov Bot commented Nov 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.84211% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 61.14%. Comparing base (bbe5bd0) to head (5a42b6e).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...odel/src/columns/__test_helpers__/stub_registry.ts 80.00% 0 Missing and 3 partials ⚠️
sdk/model/src/columns/data_column.ts 91.66% 0 Missing and 1 partial ⚠️
sdk/model/src/columns/utils.ts 85.71% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2011      +/-   ##
==========================================
+ Coverage   61.03%   61.14%   +0.11%     
==========================================
  Files         444      444              
  Lines       24135    24163      +28     
  Branches     5692     5703      +11     
==========================================
+ Hits        14730    14775      +45     
+ Misses       7734     7711      -23     
- Partials     1671     1677       +6     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant